package drz.oddb.show

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.Button
import android.widget.ImageButton
import drz.oddb.Memory.TupleList
import drz.oddb.R
import drz.oddb.view.CanvasView
import java.io.Serializable

class PaintT : AppCompatActivity(), Serializable {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.paint_path)
        val canvas = findViewById<CanvasView>(R.id.canvas)

        val baidu = findViewById<Button>(R.id.baidu).apply {
            setOnClickListener {
                canvas.showPath("baidu")
            }
        }
        val didi =  findViewById<Button>(R.id.didi).apply {
            setOnClickListener {
                canvas.showPath("didi")
            }
        }
        val helloBike =  findViewById<Button>(R.id.helloBike).apply {
            setOnClickListener {
                canvas.showPath("hello_bike")
            }
        }
        val nikeRun =  findViewById<Button>(R.id.nikeRun).apply {
            setOnClickListener {
                canvas.showPath("nike_run")
            }
        }
        val unionButton =  findViewById<ImageButton>(R.id.union).apply {
            setOnClickListener {
                canvas.showPath(intent.extras["unionPath"] as TupleList)
            }

        }
    }
}